package com.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName(value = "emp")
public class Emp {

    @TableId(type = IdType.AUTO, value = "id" )
    private Integer id;
    @TableField(value = "name")
    private String name;
    @TableField(value = "sex")
    private Integer sex;
    @TableField(value = "brithDay")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date brithDay;
    @TableField(value = "ruzhi_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date ruzhiDate;
    @TableField(value = "xueli")
    private String xueli;
    @TableField(value = "job_id")
    private Integer jobId;
    @TableField(value = "dept_id")
    private Integer deptId;
    @TableField(value = "address")
    private String address;
    @TableField(value = "phone")
    private String phone;
    @TableField(value = "emergency_contact")
    private String emergencyContact;

    /**
     * 数据库中不存在的属性，但是实体类中有，要排除
     */
    @TableField(exist = false)
    private String ruzhiDateBegin;
    @TableField(exist = false)
    private String ruzhiDateEnd;
    @TableField(exist = false)
    private String jobName;
    @TableField(exist = false)
    private String deptName;
    @TableField(exist = false)
    private String sexStr;
}
